{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Highcharts Demos\n",
    "=================\n",
    "Fixed placement columns: http://www.highcharts.com/demo/column-placement\n",
    "-------------------------------------------------------------------------"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<iframe style=\"border:0;outline:none;overflow:hidden\" srcdoc=\"&lt;!DOCTYPE html&gt;\n",
       "&lt;html lang=&quot;en&quot;&gt;\n",
       "    &lt;head&gt;\n",
       "        &lt;meta charset=&quot;utf-8&quot; /&gt;\n",
       "        &lt;link href=&quot;https://www.highcharts.com/highslide/highslide.css&quot; rel=&quot;stylesheet&quot; /&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/highcharts-more.js&quot;&gt;&lt;/script&gt;\n",
       "        &lt;script type=&quot;text/javascript&quot; src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;\n",
       "    &lt;/head&gt;\n",
       "    &lt;body style=&quot;margin:0;padding:0&quot;&gt;\n",
       "                &lt;div id=&quot;container&quot; style=&quot;width:850px;height:400px;&quot;&gt;Loading....&lt;/div&gt;\n",
       "\n",
       "\n",
       "    &lt;script&gt;\n",
       "        $(function(){\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "\n",
       "\n",
       "            Highcharts.setOptions({&quot;lang&quot;: {}, &quot;global&quot;: {}});\n",
       "            var option = {&quot;loading&quot;: {}, &quot;subtitle&quot;: {}, &quot;xAxis&quot;: {&quot;categories&quot;: [&quot;Seattle HQ&quot;, &quot;San Francisco&quot;, &quot;Tokyo&quot;]}, &quot;title&quot;: {&quot;text&quot;: &quot;Efficiency Optimization by Branch&quot;}, &quot;series&quot;: {}, &quot;labels&quot;: {}, &quot;yAxis&quot;: [{&quot;title&quot;: {&quot;text&quot;: &quot;Employees&quot;}, &quot;min&quot;: 0}, {&quot;opposite&quot;: true, &quot;title&quot;: {&quot;text&quot;: &quot;Profit (millions)&quot;}}], &quot;chart&quot;: {&quot;width&quot;: 850, &quot;renderTo&quot;: &quot;container&quot;, &quot;type&quot;: &quot;column&quot;, &quot;height&quot;: 400}, &quot;tooltip&quot;: {&quot;shared&quot;: true}, &quot;plotOptions&quot;: {&quot;column&quot;: {&quot;shadow&quot;: false, &quot;borderWidth&quot;: 0, &quot;grouping&quot;: false}}, &quot;credits&quot;: {&quot;enabled&quot;: false}, &quot;colors&quot;: {}, &quot;pane&quot;: {}, &quot;exporting&quot;: {}, &quot;drilldown&quot;: {}, &quot;navigation&quot;: {}, &quot;legend&quot;: {&quot;shadow&quot;: false}};\n",
       "\n",
       "\n",
       "            var data = [{&quot;pointPadding&quot;: 0.3, &quot;name&quot;: &quot;Employees&quot;, &quot;color&quot;: &quot;rgba(165,170,217,1)&quot;, &quot;type&quot;: &quot;column&quot;, &quot;data&quot;: [150, 73, 20], &quot;pointPlacement&quot;: -0.2}, {&quot;pointPadding&quot;: 0.4, &quot;name&quot;: &quot;Employees Optimized&quot;, &quot;color&quot;: &quot;rgba(126,86,134,.9)&quot;, &quot;type&quot;: &quot;column&quot;, &quot;data&quot;: [140, 90, 40], &quot;pointPlacement&quot;: -0.2}, {&quot;pointPadding&quot;: 0.3, &quot;name&quot;: &quot;Profit&quot;, &quot;yAxis&quot;: 1, &quot;color&quot;: &quot;rgba(248,161,63,1)&quot;, &quot;type&quot;: &quot;column&quot;, &quot;tooltip&quot;: {&quot;valueSuffix&quot;: &quot; M&quot;, &quot;valuePrefix&quot;: &quot;$&quot;}, &quot;data&quot;: [183.6, 178.8, 198.5], &quot;pointPlacement&quot;: 0.2}, {&quot;pointPadding&quot;: 0.4, &quot;name&quot;: &quot;Profit Optimized&quot;, &quot;yAxis&quot;: 1, &quot;color&quot;: &quot;rgba(186,60,61,.9)&quot;, &quot;type&quot;: &quot;column&quot;, &quot;tooltip&quot;: {&quot;valueSuffix&quot;: &quot; M&quot;, &quot;valuePrefix&quot;: &quot;$&quot;}, &quot;data&quot;: [203.6, 198.8, 208.5], &quot;pointPlacement&quot;: 0.2}]\n",
       "            option.series = data;\n",
       "\n",
       " \n",
       "\n",
       "            var chart = new Highcharts.Chart(option);\n",
       "\n",
       "\n",
       "\n",
       "\n",
       "\n",
       " \n",
       "\n",
       "\n",
       "        \n",
       "    });\n",
       "        &lt;/script&gt;\n",
       "\n",
       "    &lt;/body&gt;\n",
       "&lt;/html&gt;\" height=400 width=850></iframe>"
      ],
      "text/plain": [
       "<highcharts.highcharts.highcharts.Highchart at 0x7f11d05ec110>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import datetime\n",
    "from highcharts import Highchart\n",
    "\n",
    "H = Highchart(width=850, height=400)\n",
    "\n",
    "options = {\n",
    "\t'chart': {\n",
    "        'type': 'column'\n",
    "    },\n",
    "    'title': {\n",
    "        'text': 'Efficiency Optimization by Branch'\n",
    "    },\n",
    "    'xAxis': {\n",
    "        'categories': [\n",
    "            'Seattle HQ',\n",
    "            'San Francisco',\n",
    "            'Tokyo'\n",
    "        ]\n",
    "    },\n",
    "    'yAxis': [{\n",
    "        'min': 0,\n",
    "        'title': {\n",
    "            'text': 'Employees'\n",
    "        }\n",
    "    }, {\n",
    "        'title': {\n",
    "            'text': 'Profit (millions)'\n",
    "        },\n",
    "        'opposite': True\n",
    "    }],\n",
    "    'legend': {\n",
    "        'shadow': False\n",
    "    },\n",
    "    'tooltip': {\n",
    "        'shared': True\n",
    "    },\n",
    "    'plotOptions': {\n",
    "        'column': {\n",
    "            'grouping': False,\n",
    "            'shadow': False,\n",
    "            'borderWidth': 0\n",
    "        }\n",
    "    }\n",
    "}\n",
    "\n",
    "data1 = [150, 73, 20]\n",
    "data2 = [140, 90, 40]\n",
    "data3 = [183.6, 178.8, 198.5]\n",
    "data4 = [203.6, 198.8, 208.5]\n",
    "\n",
    "H.set_dict_options(options)\n",
    "\n",
    "H.add_data_set(data1, 'column', 'Employees', color='rgba(165,170,217,1)',\n",
    "\t\t\t\tpointPadding=0.3, pointPlacement=-0.2 )\n",
    "H.add_data_set(data2, 'column', 'Employees Optimized', color='rgba(126,86,134,.9)',\n",
    "\t\t\t\tpointPadding=0.4, pointPlacement=-0.2 )\n",
    "H.add_data_set(data3, 'column', 'Profit', color='rgba(248,161,63,1)', tooltip={\n",
    "                'valuePrefix': '$',\n",
    "                'valueSuffix': ' M'\n",
    "            },\n",
    "            pointPadding=0.3,\n",
    "            pointPlacement=0.2,\n",
    "            yAxis=1)\n",
    "H.add_data_set(data4, 'column', 'Profit Optimized', color='rgba(186,60,61,.9)',\n",
    "\t\t\ttooltip={\n",
    "                'valuePrefix': '$',\n",
    "                'valueSuffix': ' M'\n",
    "            },\n",
    "            pointPadding=0.4,\n",
    "            pointPlacement=0.2,\n",
    "            yAxis=1)\n",
    "\n",
    "H"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
